﻿using UnityEngine;
using System.Collections;

public class Lever : MonoBehaviour {


    public MovablePlatform movablePlatform;

    public SpriteRenderer[] allElements;
    public Sprite[] onElements;
    public Sprite[] offElements;

    public GameObject fx;

	public void On () 
    {
        fx.SetActive(true);
        movablePlatform.enabled = true;

        for (int i = 0; i < allElements.Length; i++)
        {
            allElements[i].sprite = onElements[i];
        }
	}

    public void Off()
    {
        fx.SetActive(false);
        movablePlatform.enabled = false;

        for (int i = 0; i < allElements.Length; i++)
        {
            allElements[i].sprite = offElements[i];
        }
    }
}
